package com.epfly.promo.activity.impl;

import com.epfly.base.id.SnowflakeIdService;
import com.epfly.promo.activity.entity.ActivityActiveStoreEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;

@Service
public class ActivitySupport {

    @Resource
    private SnowflakeIdService snowflakeIdService;


    /**
     * 获取"不限"的活跃档口
     */
    public ActivityActiveStoreEntity getUnLimitActiveStoreEn(String merchantId, Long activityId) {
        long id = snowflakeIdService.nextId();

        ActivityActiveStoreEntity activeStoreEntity = new ActivityActiveStoreEntity();
        activeStoreEntity.setId(id);
        activeStoreEntity.setMerchantId(merchantId);
        activeStoreEntity.setActivityId(activityId);
        activeStoreEntity.setStoreId(StringUtils.EMPTY);
        activeStoreEntity.setUpdateTime(LocalDateTime.now());
        activeStoreEntity.setCreateTime(LocalDateTime.now());
        return activeStoreEntity;
    }
}
